package com.smcaiot.core.exception;

import cn.hutool.core.util.StrUtil;

public class DomainException extends RuntimeException {
    public DomainException(String message) {
        super(message);
    }

    public DomainException(String message, Throwable cause) {
        super(message, cause);
    }

    public static void isTrue(boolean expression, String msgTemplate, Object... params) throws DomainException {
        if (false == expression) {
            throw new DomainException(StrUtil.format(msgTemplate, params));
        }
    }

    public static String testTransaction(String type){
        return type;
    }
}
